home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / doom / quake_ad.zip / RESPAWN.ZIP / SRC / FISH.QC < prev    next >
Text File  |  1997-03-17  |  11KB  |  247 lines

  1. $cd id1/models/fish
  2. $origin 0 0 24
  3. $base base        
  4. $skin skin
  5.  
  6. $frame attack1 attack2 attack3 attack4 attack5 attack6 
  7. $frame attack7 attack8 attack9 attack10 attack11 attack12 attack13 
  8. $frame attack14 attack15 attack16 attack17 attack18 
  9.  
  10. $frame death1 death2 death3 death4 death5 death6 death7 
  11. $frame death8 death9 death10 death11 death12 death13 death14 death15 
  12. $frame death16 death17 death18 death19 death20 death21 
  13.  
  14. $frame swim1 swim2 swim3 swim4 swim5 swim6 swim7 swim8 
  15. $frame swim9 swim10 swim11 swim12 swim13 swim14 swim15 swim16 swim17 
  16. $frame swim18 
  17.  
  18. $frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 
  19. $frame pain9 
  20.  
  21. void() swimmonster_start;
  22. //--------------------------------------------------------- New Code --------
  23. void() f_death22;
  24. //---------------------------------------------------------------------------
  25.  
  26. void() f_stand1  =[      $swim1, f_stand2 ] {ai_stand();};
  27. void() f_stand2  =[      $swim2, f_stand3 ] {ai_stand();};
  28. void() f_stand3  =[      $swim3, f_stand4 ] {ai_stand();};
  29. void() f_stand4  =[      $swim4, f_stand5 ] {ai_stand();};
  30. void() f_stand5  =[      $swim5, f_stand6 ] {ai_stand();};
  31. void() f_stand6  =[      $swim6, f_stand7 ] {ai_stand();};
  32. void() f_stand7  =[      $swim7, f_stand8 ] {ai_stand();};
  33. void() f_stand8  =[      $swim8, f_stand9 ] {ai_stand();};
  34. void() f_stand9  =[      $swim9, f_stand10  ] {ai_stand();};
  35. void() f_stand10 =[      $swim10, f_stand11 ] {ai_stand();};
  36. void() f_stand11 =[      $swim11, f_stand12 ] {ai_stand();};
  37. void() f_stand12 =[      $swim12, f_stand13 ] {ai_stand();};
  38. void() f_stand13 =[      $swim13, f_stand14 ] {ai_stand();};
  39. void() f_stand14 =[      $swim14, f_stand15 ] {ai_stand();};
  40. void() f_stand15 =[      $swim15, f_stand16 ] {ai_stand();};
  41. void() f_stand16 =[      $swim16, f_stand17 ] {ai_stand();};
  42. void() f_stand17 =[      $swim17, f_stand18 ] {ai_stand();};
  43. void() f_stand18 =[      $swim18, f_stand1 ] {ai_stand();};
  44.  
  45. void() f_walk1  =[      $swim1, f_walk2 ] {ai_walk(8);};
  46. void() f_walk2  =[      $swim2, f_walk3 ] {ai_walk(8);};
  47. void() f_walk3  =[      $swim3, f_walk4 ] {ai_walk(8);};
  48. void() f_walk4  =[      $swim4, f_walk5 ] {ai_walk(8);};
  49. void() f_walk5  =[      $swim5, f_walk6 ] {ai_walk(8);};
  50. void() f_walk6  =[      $swim6, f_walk7 ] {ai_walk(8);};
  51. void() f_walk7  =[      $swim7, f_walk8 ] {ai_walk(8);};
  52. void() f_walk8  =[      $swim8, f_walk9 ] {ai_walk(8);};
  53. void() f_walk9  =[      $swim9, f_walk10  ] {ai_walk(8);};
  54. void() f_walk10 =[      $swim10, f_walk11 ] {ai_walk(8);};
  55. void() f_walk11 =[      $swim11, f_walk12 ] {ai_walk(8);};
  56. void() f_walk12 =[      $swim12, f_walk13 ] {ai_walk(8);};
  57. void() f_walk13 =[      $swim13, f_walk14 ] {ai_walk(8);};
  58. void() f_walk14 =[      $swim14, f_walk15 ] {ai_walk(8);};
  59. void() f_walk15 =[      $swim15, f_walk16 ] {ai_walk(8);};
  60. void() f_walk16 =[      $swim16, f_walk17 ] {ai_walk(8);};
  61. void() f_walk17 =[      $swim17, f_walk18 ] {ai_walk(8);};
  62. void() f_walk18 =[      $swim18, f_walk1 ] {ai_walk(8);};
  63.  
  64. void() f_run1  =[      $swim1, f_run2 ] {ai_run(12);
  65.     if (random() < 0.5)
  66.         sound (self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM);
  67. };
  68. void() f_run2  =[      $swim3, f_run3 ] {ai_run(12);};
  69. void() f_run3  =[      $swim5, f_run4 ] {ai_run(12);};
  70. void() f_run4  =[      $swim7, f_run5 ] {ai_run(12);};
  71. void() f_run5  =[      $swim9, f_run6 ] {ai_run(12);};
  72. void() f_run6  =[      $swim11, f_run7 ] {ai_run(12);};
  73. void() f_run7  =[      $swim13, f_run8 ] {ai_run(12);};
  74. void() f_run8  =[      $swim15, f_run9 ] {ai_run(12);};
  75. void() f_run9  =[      $swim17, f_run1 ] {ai_run(12);};
  76.  
  77. void() fish_melee =
  78. {
  79.     local vector    delta;
  80.     local float     ldmg;
  81.  
  82.     if (!self.enemy)
  83.         return;        // removed before stroke
  84.         
  85.     delta = self.enemy.origin - self.origin;
  86.  
  87.     if (vlen(delta) > 60)
  88.         return;
  89.         
  90.     sound (self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM);
  91.     ldmg = (random() + random()) * 3;
  92.     T_Damage (self.enemy, self, self, ldmg);
  93. };
  94.  
  95. void() f_attack1        =[      $attack1,       f_attack2 ] {ai_charge(10);};
  96. void() f_attack2        =[      $attack2,       f_attack3 ] {ai_charge(10);};
  97. void() f_attack3        =[      $attack3,       f_attack4 ] {fish_melee();};
  98. void() f_attack4        =[      $attack4,       f_attack5 ] {ai_charge(10);};
  99. void() f_attack5        =[      $attack5,       f_attack6 ] {ai_charge(10);};
  100. void() f_attack6        =[      $attack6,       f_attack7 ] {ai_charge(10);};
  101. void() f_attack7        =[      $attack7,       f_attack8 ] {ai_charge(10);};
  102. void() f_attack8        =[      $attack8,       f_attack9 ] {ai_charge(10);};
  103. void() f_attack9        =[      $attack9,       f_attack10] {fish_melee();};
  104. void() f_attack10       =[      $attack10,      f_attack11] {ai_charge(10);};
  105. void() f_attack11       =[      $attack11,      f_attack12] {ai_charge(10);};
  106. void() f_attack12       =[      $attack12,      f_attack13] {ai_charge(10);};
  107. void() f_attack13       =[      $attack13,      f_attack14] {ai_charge(10);};
  108. void() f_attack14       =[      $attack14,      f_attack15] {ai_charge(10);};
  109. void() f_attack15       =[      $attack15,      f_attack16] {fish_melee();};
  110. void() f_attack16       =[      $attack16,      f_attack17] {ai_charge(10);};
  111. void() f_attack17       =[      $attack17,      f_attack18] {ai_charge(10);};
  112. void() f_attack18       =[      $attack18,      f_run1    ] {ai_charge(10);};
  113.  
  114. //--------------------------------------------------------- New Code --------
  115. //  The rotfish will not rot!
  116. //---------------------------------------------------------------------------
  117. void()  f_revive1       =[      $death21,       f_revive3       ]
  118. {       self.nextthink = self.nextthink + PM_SleepTime();
  119.         self.health = 0;
  120. };
  121. void()  f_revive2       =[      $death21,       f_revive3       ]
  122. {       self.nextthink = self.nextthink + 5;    };
  123. void()  f_revive3       =[      $death21,       f_revive4       ]
  124. {       // see if ok to stand up
  125.         self.health = 25;
  126.         sound (self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_IDLE);
  127.         self.solid = SOLID_SLIDEBOX;
  128.         if (!walkmove (0, 0))
  129.         {       self.think = f_revive2;
  130.                 self.solid = SOLID_NOT;
  131.                 return;
  132.         }
  133. };
  134. void() f_revive4        =[      $death20,       f_revive5       ] {};
  135. void() f_revive5        =[      $death19,       f_revive6       ] {};
  136. void() f_revive6        =[      $death18,       f_revive7       ] {};
  137. void() f_revive7        =[      $death17,       f_revive8       ] {};
  138. void() f_revive8        =[      $death16,       f_revive9       ] {};
  139. void() f_revive9        =[      $death15,       f_revive10      ] {};
  140. void() f_revive10       =[      $death14,       f_revive11      ] {};
  141. void() f_revive11       =[      $death13,       f_revive12      ] {};
  142. void() f_revive12       =[      $death12,       f_revive13      ] {};
  143. void() f_revive13       =[      $death11,       f_revive14      ] {};
  144. void() f_revive14       =[      $death10,       f_revive15      ] {};
  145. void() f_revive15       =[      $death9,        f_revive16      ] {};
  146. void() f_revive16       =[      $death8,        f_revive17      ] {};
  147. void() f_revive17       =[      $death7,        f_revive18      ] {};
  148. void() f_revive18       =[      $death6,        f_revive19      ] {};
  149. void() f_revive19       =[      $death5,        f_revive20      ] {};
  150. void() f_revive20       =[      $death4,        f_revive21      ] {};
  151. void() f_revive21       =[      $death3,        f_revive22      ] {};
  152. void() f_revive22       =[      $death2,        f_revive23      ] {};
  153. void() f_revive23       =[      $death1,        f_run1          ]
  154. {       self.origin = self.origin + '0 0 1';
  155.     if (self.flags & FL_ONGROUND)
  156.         self.flags = self.flags - FL_ONGROUND;
  157.         self.flags = self.flags | FL_SWIM;
  158.         self.takedamage = DAMAGE_AIM;
  159. };
  160. //---------------------------------------------------------------------------
  161.  
  162. void() f_death1 =[      $death1,        f_death2        ] {
  163. sound (self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM);
  164. };
  165. void() f_death2 =[      $death2,        f_death3        ] {};
  166. void() f_death3 =[      $death3,        f_death4        ] {};
  167. void() f_death4 =[      $death4,        f_death5        ] {};
  168. void() f_death5 =[      $death5,        f_death6        ] {};
  169. void() f_death6 =[      $death6,        f_death7        ] {};
  170. void() f_death7 =[      $death7,        f_death8        ] {};
  171. void() f_death8 =[      $death8,        f_death9        ] {};
  172. void() f_death9 =[      $death9,        f_death10       ] {};
  173. void() f_death10 =[      $death10,       f_death11       ] {};
  174. void() f_death11 =[      $death11,       f_death12       ] {};
  175. void() f_death12 =[      $death12,       f_death13       ] {};
  176. void() f_death13 =[      $death13,       f_death14       ] {};
  177. void() f_death14 =[      $death14,       f_death15       ] {};
  178. void() f_death15 =[      $death15,       f_death16       ] {};
  179. void() f_death16 =[      $death16,       f_death17       ] {};
  180. void() f_death17 =[      $death17,       f_death18       ] {};
  181. void() f_death18 =[      $death18,       f_death19       ] {};
  182. void() f_death19 =[      $death19,       f_death20       ] {};
  183. void() f_death20 =[      $death20,       f_death21       ] {};
  184. //--------------------------------------------------------- Code Change -----
  185. void() f_death21 =
  186. {       if (PM_Revive())
  187.         {       self.solid = SOLID_NOT;
  188.                 f_revive1();
  189.         }
  190.         else  f_death22();
  191. };
  192. void() f_death22 =[      $death21,       f_death21       ] {self.solid = SOLID_NOT;};
  193. //---------------------------------------------------------------------------
  194.  
  195. void() f_pain1  =[      $pain1, f_pain2 ] {};
  196. void() f_pain2  =[      $pain2, f_pain3 ] {ai_pain(6);};
  197. void() f_pain3  =[      $pain3, f_pain4 ] {ai_pain(6);};
  198. void() f_pain4  =[      $pain4, f_pain5 ] {ai_pain(6);};
  199. void() f_pain5  =[      $pain5, f_pain6 ] {ai_pain(6);};
  200. void() f_pain6  =[      $pain6, f_pain7 ] {ai_pain(6);};
  201. void() f_pain7  =[      $pain7, f_pain8 ] {ai_pain(6);};
  202. void() f_pain8  =[      $pain8, f_pain9 ] {ai_pain(6);};
  203. void() f_pain9  =[      $pain9, f_run1 ] {ai_pain(6);};
  204.  
  205. void(entity attacker, float damage)    fish_pain =
  206. {
  207.  
  208. // fish allways do pain frames
  209.     f_pain1 ();
  210. };
  211.  
  212.  
  213.  
  214. /*QUAKED monster_fish (1 0 0) (-16 -16 -24) (16 16 24) Ambush
  215. */
  216. void() monster_fish =
  217. {
  218.     if (deathmatch)
  219.     {
  220.         remove(self);
  221.         return;
  222.     }
  223.     precache_model2 ("progs/fish.mdl");
  224.  
  225.     precache_sound2 ("fish/death.wav");
  226.     precache_sound2 ("fish/bite.wav");
  227.     precache_sound2 ("fish/idle.wav");
  228.  
  229.     self.solid = SOLID_SLIDEBOX;
  230.     self.movetype = MOVETYPE_STEP;
  231.  
  232.     setmodel (self, "progs/fish.mdl");
  233.  
  234.     setsize (self, '-16 -16 -24', '16 16 24');
  235.     self.health = 25;
  236.     
  237.     self.th_stand = f_stand1;
  238.     self.th_walk = f_walk1;
  239.     self.th_run = f_run1;
  240.     self.th_die = f_death1;
  241.     self.th_pain = fish_pain;
  242.     self.th_melee = f_attack1;
  243.     
  244.     swimmonster_start ();
  245. };
  246.  
  247.